<%@page import="org.apache.commons.lang.StringUtils"%>
<%@page import="org.apache.commons.lang.time.DateFormatUtils"%>
<%@page import="org.springframework.util.CollectionUtils"%>
<%@page import="java.util.Collection"%>
<%@ include file="../common/common_include.jsp"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%
	List<TblOaSoft> list = (List<TblOaSoft>)request.getAttribute("list");
	SoftForm form = (SoftForm)request.getAttribute("command");
	List<TblOaSoftType> fileTypeList = (List<TblOaSoftType>)request.getAttribute("fileTypeList");	
	
	String fileType = (null!=form.getTypeId())?form.getTypeId():"";
	String fileName = (null!=form.getName())?form.getName():"";
	String publicMan = (null!=form.getPublicMan())?form.getPublicMan():"";
	String createDateBegin = (null!=form.getCreateDateBegin())?form.getCreateDateBegin():"";
	String createDateEnd = (null!=form.getCreateDateEnd())?form.getCreateDateEnd():""; 

%>

<div class="userListWrap">
	<form id="softListForm">
		<div class="form-item">
			<label for="fileName">标题</label> <input class="easyui-validatebox"
				type="text" name="fileName" data-options="" value="<%=fileName %>"/>
		</div>
		<div class="form-item">
			<label for="fileType">软件类型:</label>
								<select name="fileType">
								<option value="">全部</option>
									<%
										if(!CollectionUtils.isEmpty(fileTypeList)){
											for(TblOaSoftType coreFileType: fileTypeList){
												String type = coreFileType.getTypeId()+"";
												String typeName = coreFileType.getFileType();
												%>
										    	<option value="<%=type%>" <%=fileType.equalsIgnoreCase(type)?"selected=selected":""%>><%=typeName%></option>
												<%
											}
										}
									%>
								</select>			
			
		</div>
		<div class="form-item">
			<label for="publicMan">发布人</label> <input class="easyui-validatebox"
				type="text" name="publicMan" data-options="" value="<%=publicMan %>" />
		</div>
		<div class="form-item form-item-two">
			<label>创建时间:</label> <input id="createDateBegin"
				name="createDateBegin" type="text" class="easyui-datebox">--
			<input id="createDateEnd" name="createDateEnd" type="text"
				class="easyui-datebox">
		</div>

		<div class="form-item form-item">
			<a href="javascript:XF.Soft.listSoftSearch()"
				class="input-btn-microsoft input-btn-microsoft-24">搜索</a>
		</div>
	</form>

	<table id="softListTable" class="easyui-datagrid" title="">
		<thead>
			<tr>
				<!-- <th
					data-options="field:'select',width:80,align:'center',checkbox:'true'"><input
					type="checkbox"></th> -->
				<th data-options="field:'fileName',width:290"
					orderByField='fileName'>软件名称</th>
				<th data-options="field:'size',width:60"
					orderByField='fileName'>大小</th>
				<th data-options="field:'fileType',width:140"
					orderByField='fileType'>软件类型</th>
				<!-- <th data-options="field:'fileDesc',width:300"
					orderByField='fileDesc'>软件说明</th>	 -->				
				<th data-options="field:'publicMan',width:100"
					orderByField='publicMan'>发布人</th>
				<th data-options="field:'publicTime',width:100"
					orderByField='publicTime'>发布时间</th>
				<th data-options="field:'op',width:100">操作</th>
			</tr>
		</thead>
		<tbody>
			<%
				if(!CollectionUtils.isEmpty(list)){
					for(TblOaSoft soft:list){
						%>
			<tr s="<%=soft.getFileId() %>">
				<!-- <td><input type="checkbox"></td> -->
				<td><%=soft.getFileName()%></td>
				<td><%=(null!=soft.getFileSize())?soft.getFileSize():"0"%>M  </td>
				<td><%=soft.getFileType() %></td>
				<%-- <td><%=soft.getFileDesc()%></td> --%>
				<td><%=StringUtils.isNotBlank(soft.getPublicMan())?soft.getPublicMan():""%></td>
				<td><%=null!=soft.getPublicDate()?DateFormatUtils.format(soft.getPublicDate().getTime(), "yyyy-MM-dd"):"" %></td>
				<td>
					<a class="inLink" href="javascript:XF.Soft.editSoft('<%=EncrypTool.encode(soft.getFileId()+"")%>')"><span>编辑</span></a>
					<a href="javascript:XF.Soft.deleteSoft('<%=EncrypTool.encode(soft.getFileId()+"")%>')"><span>删除</span></a>				
				</td>

			</tr>
						<%
					}
				}
			
			%>
		</tbody>
	</table>
	<div class="pagination paginationFixWidth">
		<monggoTag:pagination href="listSoft_search"
			pageSize="<%=form.getPageSize()%>"
			totalRecord="<%=form.getTotalRecord() %>"
			currentPage="<%=form.getPageNum() %>">
		</monggoTag:pagination>
	</div>
</div>


<script type="text/javascript">
$('#softListTable').datagrid(); 
$("#createDateBegin").datebox({
	formatter:XF.dateFormatter,
	parser:XF.dateParse
});
$("#createDateEnd").datebox({
	formatter:XF.dateFormatter,
	parser:XF.dateParse
});
	
</script>
</html>